package com.zj.rocketmq.demo.service;

import com.zj.rocketmq.demo.entity.TOrder;
import com.zj.rocketmq.demo.repository.TOrderRepository;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

@Service
@Transactional
public class TorderService {

    @Resource
    private TOrderRepository orderRepository;

    public void save(TOrder order) {
        orderRepository.save(order);
    }

    public TOrder getByOrderNo(String orderNo) {
        return orderRepository.findByOrderNo(orderNo);
    }
}
